package com.xing.dao.user;

import com.xing.pojo.Role;
import com.xing.pojo.User;

import java.sql.SQLException;
import java.util.List;
//用户Dao
public interface UserDao {
    //根据编号和密码得到要登录的用户
    public User getLoginUser(String userCode,String userPassword) throws SQLException, ClassNotFoundException;
    //修改用户密码
    public int updatePwd(int id, String userPassword) throws SQLException, ClassNotFoundException;

    //根据用户名或者角色查询用户总数
    public int getUserCount(String username,int userRole) throws SQLException, ClassNotFoundException;

    //获取用户列表
    public List<User> getUserList(String username,int userRole,int currentPageNo,int pageSize) throws SQLException, ClassNotFoundException;

    //通过用户编码获取用户
    public User getUserByUserCode(String userCode) throws SQLException, ClassNotFoundException;

    //通过用户Id查询用户
    public User getUserById(int id) throws SQLException, ClassNotFoundException;

    //增加用户
    public int addUser(User user) throws SQLException, ClassNotFoundException;

    //删除用户
    public int delUser(int id) throws SQLException, ClassNotFoundException;

    //修改用户
    public int modifyUser(User user) throws SQLException, ClassNotFoundException;
}
